$(document).ready(function()
{
	var mySwiper = $('#slides .main_slides').swiper(
	{
		speed:300,
		slideClass: 'slide',
		wrapperClass: 'slides_container',
		autoPlay: 5000,
		loop: true,
		resizeEvent: 'resize',
		simulateTouch: true,
		pagination : '.pagination',
		paginationClickable : true,
		onSlideChangeEnd: function()
		{
			mySwiper.stopAutoPlay();
			mySwiper.startAutoPlay();
		}
	});
	
	var imagem  = $("div#slider_div div.slide img")[0];
	
	$(imagem).load(function()
	{
		var img_height = imagem.clientHeight;
		$("div#slides , div#slider_div, div#slider_div div.slide").height(img_height);
	});
	
	window.addEventListener('resize', handleResize, false);

	function handleResize() 
	{
		var img_height = ($("div#slider_div div.slide img")[0]).clientHeight;
		$("div#slides , div#slider_div, div#slider_div div.slide").height(img_height);
	}

});